package com.threaddemo1;

public class InterruptDemo {

    public static void main(String[] args) throws InterruptedException {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("isInterrupted A = "+Thread.currentThread().isInterrupted());
                try {
                    Thread.sleep(10 * 1000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                System.out.println("这里能执行吗？？？？？");
            }
        });
        t.start();
        t.interrupt();//设置一个中断状态
        Thread.sleep(5 * 1000);
        System.out.println("isInterrupted B = "+t.isInterrupted());

        System.out.println("这你能执行到吗？");
    }

}
